
<template>
    <vo-table ref="yuTable" :data="data.tableData.data" :cols="data.tableData.cols" :config="data.tableData.config" @fetch-data="query" @vue:mounted="query"  >
      <template #leftBar>
        <tiny-input v-model="data.searchData.appId" placeholder="appId"></tiny-input>
        <tiny-input v-model="data.searchData.appNameLike" placeholder="名称"></tiny-input>
        <tiny-input v-model="data.searchData.tagLike" placeholder="tag"></tiny-input>
        <tiny-input v-model="data.searchData.namespaceId" placeholder="系统空间"></tiny-input>
        <tiny-button  size="small" ghost type="info" @click="query"  ><vo-icon iconName="sousuo"  ></vo-icon>查询</tiny-button>
        </template>
        <template #rightBar>

        </template>
          <tiny-button-group class="ml-4">
            <tiny-button ghost type="success" size="small"  @click="addDict"><vo-icon iconName="add" ></vo-icon>新增</tiny-button>
            <tiny-button ghost type="warning" size="small" @click="cacheBtn"><vo-icon iconName="jinbi1" ></vo-icon>数据缓存</tiny-button>
        </tiny-button-group>

        <template v-slot:handleSlot="{row}">
        <tiny-button-group class="ml-4">
          <tiny-button size="mini" ghost type="success" @click="editBtn(row)">编辑</tiny-button>
          <tiny-button size="mini" ghost type="danger" @click="showtask(row)">进入 </tiny-button>
        </tiny-button-group>
      </template>
           
    </vo-table>
</template>
<script setup>
import {reactive, ref, getCurrentInstance,onMounted} from 'vue';  
import {cosSystem} from '@/stores/system.js';
const {proxy} = getCurrentInstance();
let store = cosSystem();
  const data = reactive({
    tableData: {  data: {}, cols: [],  config: {} },
    searchData: {  appId: '',  appNameLike: '',  tagLike: '',namespaceId: '',index: 0,pageSize: 10},
  })
  data.tableData.data = [{dictCode: '123', dictName: '123'}]
  data.tableData.cols = [
    {type: 'index',title: '序号'},
    {title: '编码', key: 'appName', align: 'left'},
    {title: '名称', key: 'title', align: 'left'},
    {title: '空间', key: 'namespaceName', align: 'left'},
    {title: '创建时间', key: 'gmtCreateStr', align: 'left'},
    {title: '修改时间', key: 'gmtModifiedStr', align: 'left'},
    {title: '创建人', key: 'creatorShowName', align: 'left'},
    {title: '修改人', key: 'modifierShowName', align: 'left'},
    { title: '操作', align: 'center', slot: 'handleSlot',  },
]
 const showtask = (row)=>{
  store.powerJob.appId=row.id;;
  proxy.$router.push({path:'/sys/pwoerJob/welcome'});
 }
const query = ()=>{
  data.searchData.showMyRelated = false;
  proxy.$api.taskJob.queryAppList(data.searchData).then(res=>{
     console.log(res)
     data.tableData.data = res

  })
}
</script>

<style lang="scss" scoped>



</style>